home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / tydhtml / dyn.exe / Chap06 / dyn6_3.txt < prev    next >
Encoding:
Text File  |  1997-10-02  |  702 b   |  27 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Mouse Movements</TITLE>
  4. </HEAD>
  5. <SCRIPT language="javascript">
  6. document.captureEvents(Event.MOUSEMOVE);
  7. function HandleEvent (e) {
  8.   message = "Event = " + e.type + ". "; //identify the event type
  9.   message += "x,y position = " + e.layerX + ", " + e.layerY; //where click was
  10.   document.displayForm.coordinates.value = message; //display the information
  11.   return true;
  12. }
  13. document.onmousemove = HandleEvent;
  14. </SCRIPT>
  15. <BODY>
  16. <H1>Here's a page</H1>
  17. <P>Howdy</P>
  18. <H1>Here's a page</H1>
  19. <P>Howdy</P>
  20. <H1>Here's a page</H1>
  21. <P>Howdy</P>
  22. <FORM name="displayForm">
  23. <INPUT name="coordinates" type=text size="45">
  24. </FORM>
  25. </BODY>
  26. </HTML>
  27.